<template>
  <view class="content">
    <button @click="handleDevice">获取设备id</button>
    <button @click="handleOAID">获取OAID</button>
    <view class="text-area">
      <view class="title">设备id:{{deviceId}}</view>
      <view class="title">设备id:{{JSON.stringify(oaid)}}</view>
    </view>
  </view>
</template>

<script>
  import { getDeviceId16 } from "@/uni_modules/droid-util"
  import oaidUtil from "@/uni_modules/droid-util/utssdk/OaidUtils"
  export default {
    data() {
      return {
        deviceId: '',
        oaid: ""
      }
    },
    onLoad() {

    },
    methods: {
      handleDevice() {
        this.deviceId = getDeviceId16()
      },
      async handleOAID() {
        this.oaid = await oaidUtil.getOAID()
      }
    }
  }
</script>

<style>
  .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .logo {
    height: 200rpx;
    width: 200rpx;
    margin-top: 200rpx;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50rpx;
  }

  .text-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20rpx;
  }

  .title {
    font-size: 36rpx;
    color: #8f8f94;
    padding: 20rpx;
    width: 80%;
    display: inline-block;
    white-space: pre-wrap;
    word-wrap: break-all;
    height: auto;
  }
</style>